<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .gray {
        color: gray;
      }
      .black {
        color: black;
      }
    </style>
  </head>
  <body>
    <script src="common.js"></script>
    <input type="text" id="inputseach" class="gray" value="请输入搜索关键字" />
    <script>
      var inputseach = my$("inputseach");
      inputseach.onfocus = function () {
        if (this.value == "请输入搜索关键字") {
          this.value = "";
          this.className = "black";
        }
      };
      inputseach.onblur = function () {
        if (this.value == "") {
          this.value = "请输入搜索关键字";
          this.className = "gray";
        }
      };
    </script>
  </body>
</html>
